package org.bozo.im.service.protocols.jabber;

import org.bozo.im.common.types.Presence;

public class JabberUtils {

	public static org.bozo.im.common.types.Presence convert(org.jivesoftware.smack.packet.Presence pPresence) {
		org.bozo.im.common.types.Presence lPresence = null;

		switch (pPresence.getMode()) {
		case available:
		case chat:
			lPresence = Presence.ONLINE;
			break;
		case away:
		case xa:
			lPresence = Presence.AWAY;
			break;
		case dnd:
			lPresence = Presence.BUSY;
			break;
		default:
			lPresence = Presence.OFFLINE;
			break;
		}

		return lPresence;
	}

}
